package utilities;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

import utilDataStruct.FileStruct;

public class SingleTableHandler {

	public static void PassSingleFileIntoMatchResult(String tFolder, 
			List<FileStruct> fileList, List<Integer> fnList) {
		
		String line1 = "\t\tFileSystem fs = FileSystem.get(globalConf);";
		String line2 = "\t\tfs.rename(new Path(args[1] + \"/temp%_%" + fileList.get(0).getTableName() + "%_%" + fnList.get(0) + "\"), new Path(args[1] + \"/MatchResult\"));";
		BufferedWriter bw;
		try {
			bw = new BufferedWriter(new FileWriter(tFolder + File.separator + "tempProfile", true));
			
			bw.write(line1 + "\n" + line2 + "\n");
			bw.flush();
			
			bw.close();
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}
}
